package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.UserBankDetail;

import java.util.Date;


/**
 * <p>
 * 
 * </p>
 *
 * @author QR
 * @since 2021-12-14
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_user_bank")
public class DtrdEntRdUserBank {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("user_bank_user_id")
    private Integer userBankUserId;

    @TableField("user_bank_user_type")
    private Integer userBankUserType;

    @TableField("user_bank_bank_id")
    private Integer userBankBankId;

    @TableField("user_bank_bank_card")
    private String userBankBankCard;

    @TableField("user_bank_user_name")
    private String userBankUserName;

    @TableField("user_bank_is_default")
    private Integer userBankIsDefault;

    @TableField("user_bank_card_type")
    private Integer userBankCardType;

    @TableField("user_bank_account_type")
    private Integer userBankAccountType;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;

    public DtrdEntRdUserBank init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdUserBank parseFromDto(UserBankDetail dto) {
        dataId = dto.getDataId();
        userBankUserType = dto.getUserBankUserType();
        userBankUserId = dto.getUserBankUserId();
        userBankBankId = dto.getUserBankBankId();
        userBankBankCard = dto.getUserBankBankCard();
        userBankUserName = dto.getUserBankUserName();
        userBankCardType = dto.getUserBankCardType();
        userBankAccountType = dto.getUserBankAccountType();
        return this;
    }


}
